package com.cq.hd.member.api;

import com.alibaba.fastjson.JSONObject;
import com.cq.hd.common.response.Result;
import com.cq.hd.member.api.dto.*;
import com.cq.hd.member.api.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "hd-o2o-member-service", contextId = "agent-enter-apply-api")
public interface TbAgentEnterApplyApi {

    // 经纪人入驻预申请（供用户点击入驻申请链接调用）
    @PostMapping("/member/agentEnterApply/preApply")
    Result<PreAgentApplyMerchantVo> preApply(@RequestBody PreAgentEnterApplyDto preAgentApplyMerchantDto);

    // 经纪人绑定商家（经纪人开户）
    @PostMapping("/member/agentEnterApply/bind")
    Result<Boolean> bind(@RequestBody BusinessAgentBindDto BusinessAgentBindDto);

    // 经纪人开户
    @PostMapping("/member/agentEnterApply/bindHf")
    Result<AgentEnterApplyVo> bindHf(@RequestBody AgentBindHfDto agentBindHfDto);

    // 返回已签约的银行卡列表
    @GetMapping("/member/agentEnterApply/listBank")
    Result<List<AgentBankCardVo>> listBank(@RequestParam("userId") Long userId);

    // 经纪人入驻，绑定银行卡，并做签约，返回签约地址
    @PostMapping("/member/agentEnterApply/enterApply")
    Result<AgentEnterApplyVo> enterApply(@RequestBody AgentEnterApplyDto agentEnterApplyDto);

    // 是否存在入驻失败/签约失败的入驻数据
    @GetMapping("/member/agentEnterApply/getEnterInfoState")
    Result<AgentEnterApplyStateVo> getEnterInfoState(@RequestParam("userId") Long userId);

    // 用户业务入驻异步通知回调
    @PostMapping("/member/agentEnterApply/agentUserEntAuditCallback")
    Result<Boolean> agentUserEntAuditCallback(@RequestBody JSONObject dataObj);

    // 用户签约结果异步通知回调
    @PostMapping("/member/agentEnterApply/agentUserSignCallback")
    Result<Boolean> agentUserSignCallback(@RequestBody JSONObject dataObj);

    // 根据条件获取入驻数据
    @GetMapping("/member/agentEnterApply/listByDto")
    Result<List<AgentEnterApplyDetailVo>> listByDto(@SpringQueryMap AgentEnterApplyDetailDto agentEnterApplyDetailDto);

    // 修改银行卡
    @PutMapping("/member/agentEnterApply/updateBankInfo")
    Result<Boolean> updateBankInfo(@RequestBody AgentUpdateBankInfoDto agentUpdateBankInfoDto);
}
